package movEat.GUI;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ShellAdapter;
import org.eclipse.swt.events.ShellEvent;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;

import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;

public class EatShell{


	static Shell getShell(final MP3 mp3){

		Shell shell = SWTUtil.getShell(GUI.shell);
		shell.setLayout(new org.eclipse.swt.layout.GridLayout(1, false));
		Image burger = new Image(SWTUtil.getDisplay(), "resources/burgers.jpg");
		shell.setBackgroundImage(burger);
		shell.setBackgroundMode(SWT.INHERIT_DEFAULT);
		//shell.pack();
		Label moveat = new Label(shell, SWT.NONE);
		moveat.setText("MovEat!\n\nMovEat!!");
		moveat.setFont(new Font(SWTUtil.getDisplay(), "Segoe Print", 70, SWT.BOLD));
		moveat.setForeground(SWTUtil.getDisplay().getSystemColor(SWT.COLOR_WHITE));

		mp3.play();
		shell.addShellListener(new ShellAdapter() {
			public void shellClosed(ShellEvent e) {
				mp3.close();
			}
		});
		
		return shell;


	}
}
